package com.baomidou.springwind.test;

import java.util.Random;

/**
 * Created by Administrator on 2016/12/19.
 */
public abstract class Tosser implements Randomer {
    protected Seeder curseed;
    protected int turn;

    public final static Randomer getTosserInstance(String type, int turn) {
        if (type.equalsIgnoreCase("coin")) {
            return new Coin(turn);
        } else {
            return new Dice(turn);
        }
    }

    public Tosser(Seeder curseed, int turn) {
        this.turn = turn;
        this.curseed = curseed;
    }

    public void changeSeeder(Seeder seeder) {
        curseed = seeder;
    }

    @Override
    public Seeder getSeeder() {
        return curseed;
    }

    public abstract void showResults();
    public abstract void runToss();
}
